const express = require("express");
const router = express.Router();
const path = require("path");
const fs = require("fs");

const config = require("../../config/index.js");

router.get("/getBaseConfig", (req, res) => {
  const response = {
    code: 200,
    data: config,
    msg: "获取配置成功",
  };
  res.send(response);
});

router.post("/updateBaseConfig", (req, res) => {
  const filePath = path.join(__dirname, "../../config/index.js");
  const response = {
    code: 200,
    data: config,
    msg: "获取配置成功",
  };
  res.send(response);
});

module.exports = router;
